Forward warnings from build scripts
authorAlex Crichton <alex@alexcrichton.com>
Tue, 12 Apr 2016 21:28:52 +0000 (14:28 -0700)
committerAlex Crichton <alex@alexcrichton.com>
Tue, 14 Jun 2016 14:35:40 +0000 (07:35 -0700)
commita30f612ed9d744d967ec9708241d93ccd0da3328
tree44a77cbf2c2dcfdb657f45e0e9d169dedb3f4a96
parent941f48815cd44bd9281873e2d0304ffdd1af6eac
Forward warnings from build scripts

This adds support for forwarding warnings from build scripts to the main console
for diagnosis. A new `warning` metadata key is recognized by Cargo and is
printed after a build script has finished executing.

The purpose of this key is for build dependencies to try to produce useful
warnings for local crates being developed. For example a parser generator could
emit warnings about ambiguous grammars or the gcc crate could print warnings
about the C/C++ code that's compiled.

Warnings are only emitted for path dependencies by default (like lints) so
warnings printed in crates.io crates are suppressed.

cc #1106
src/cargo/ops/cargo_compile.rs
src/cargo/ops/cargo_rustc/context.rs
src/cargo/ops/cargo_rustc/custom_build.rs
src/cargo/ops/cargo_rustc/job_queue.rs
src/cargo/ops/cargo_rustc/mod.rs
src/doc/build-script.md
tests/build-script.rs